package com.tianyu.inspection.entity.vo;

import com.tianyu.inspection.common.enums.RoState;
import lombok.Data;
import lombok.experimental.Accessors;

/**********************************
 * @Author YSW
 * @Description 接口返回通用类型 Ro(Return Object)(请求返回类型)
 * @Date 2021/1/6 - 18:34
 **********************************/

@Data
@Accessors(chain = true)
public class Ro<T> {
    private Integer state;
    private String message;
    private T content;

    public Ro() {
        setResultEnum(RoState.SUCCESS);
    }

    public Ro(RoState re) {
        this.state = re.getValue();
        this.message = re.getMessage();
    }

    public Ro<T> setResultEnum(RoState re){
        this.state = re.getValue();
        this.message = re.getMessage();
        return this;
    }
}
